﻿@model IEnumerable<Gfw.Web.Models.Manage.ProfitStatisticsModel>

@{
    ViewBag.Title = "公司利润统计";
    Layout = null;
}

@using Gfw.Web.Common;
@using C.Mvc
@using MvcContrib.UI.Grid;

@using (Ajax.BeginForm("ProfitList", "Statistics", null, Gfw.Web.Common.ViewHelper.AjaxGet))
{
@*
    @Html.Grid(Model).Columns(
        column =>
        {
            column.For(x => x.SettlementDate).Named("日期");
            column.For(x => x.AnnualFee).Named("会员年费");
            column.For(x => x.SellStock).Named("售股利润手续费8%");
            column.For(x => x.ToCashTax).Named("提现手续费10%");
            column.For(x => x.Tax).Named("奖金税2%");
            column.For(x => x.ChangeInformation).Named("修改资料费");
            column.For(x => x.Total).Named("合计");
            column.For(x => x.Bonus).Named("分红支出");
            column.For(x => x.Others).Named("其它费用");
            column.For(x => x.Balance).Named("累计结余");
            column.For(x => x.Abstract).Named("说明");
        }
    ).Attributes(id => "mytable", cellpadding => "0", cellspacing => "0").Empty("没有相关信息");
    *@
    
    <table id="mytable">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.SettlementDate)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.AnnualFee)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.SellStock)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ToCashTax)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Tax)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ChangeInformation)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Total)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Bonus)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Others)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Balance)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Abstract)
            </th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.SettlementDate)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.AnnualFee)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SellStock)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ToCashTax)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Tax)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ChangeInformation)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Total)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Bonus)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Others)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Balance)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Abstract)
                </td>
            </tr>
        }

        <tr>
            <td style="color:red">
                @ViewBag.SettlementDate
            </td>
            <td style="color:red">
                @ViewBag.AnnualFee
            </td>
            <td style="color:red">
                @ViewBag.SellStock
            </td>
            <td style="color:red">
                @ViewBag.ToCashTax
            </td>
            <td style="color:red">
                @ViewBag.Tax
            </td>
            <td style="color:red">
                @ViewBag.ChangeInformation
            </td>
            <td style="color:red">
                @ViewBag.Total
            </td>
            <td style="color:red">
                @ViewBag.Bonus
            </td>
            <td style="color:red">
                @ViewBag.Others
            </td>
            <td style="color:red">
                @ViewBag.Balance
            </td>
            <td style="color:red">
                @ViewBag.Abstract
            </td>
        </tr>

    </table>

    @Ajax.DataGridPager().Model(ViewBag.Model).Totals(ViewBag.TotalSize).PageIndex(ViewBag.PageIndex).PagePropertyName("page").AjaxOptions(Gfw.Web.Common.ViewHelper.AjaxGet);

             <div class="button">
               @Html.ActionLink("下载", "DownloadExcel", new { start = ViewBag.Start, end = ViewBag.End })
     </div>                                                                                                                                                                  
                                                                                                                                                                             
}